<?php

function exceptionHandler ($e) {
	
	$message = $e->getMessage ();
	$trace = htmlspecialchars ($e->getTraceAsString ());
	
	print <<<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="ru">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Ошибка</title>
	<style type="text/css">
body {
	margin: 200px auto;
	font-family: Arial;
	font-size: 10pt;
}

div#wrap {
	width: 100%;
	display: table;
	text-align: center;
}

div#block {
	display: inline-block;
	width: 400px;
	text-align: left;
	padding: 4px;
	border: #d5d5d5 1px solid;
	overflow: visible;
}

	div#block h1 {
		background: #049eff;
		padding: 4px;
		margin: 0px;
		color: #fff;
		font-size: 15pt;
	}
	
	div#block pre {
		font-size: 8pt;
	}
	</style>
</head>
<body>
<div id="wrap">
	<div id="block">
		<h1>Ошибка</h1>
		<p><strong>Неперехваченное исключение:</strong></p>
		<p>{$message}</p>
		<pre>{$trace}</pre>
	</div>
</div>
</body>
</html>
HTML;
}

set_exception_handler("exceptionHandler");